package com.ruoyi.books.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.books.mapper.BookRecordMapper;
import com.ruoyi.books.domain.BookRecord;
import com.ruoyi.books.service.IBookRecordService;

/**
 * 领还记录表单Service业务层处理
 * 
 * @author wt
 * @date 2025-03-16
 */
@Service
public class BookRecordServiceImpl implements IBookRecordService 
{
    @Autowired
    private BookRecordMapper bookRecordMapper;

    /**
     * 查询领还记录表单
     * 
     * @param id 领还记录表单主键
     * @return 领还记录表单
     */
    @Override
    public BookRecord selectBookRecordById(String id)
    {
        return bookRecordMapper.selectBookRecordById(id);
    }

    /**
     * 查询领还记录表单列表
     * 
     * @param bookRecord 领还记录表单
     * @return 领还记录表单
     */
    @Override
    public List<BookRecord> selectBookRecordList(BookRecord bookRecord)
    {
        return bookRecordMapper.selectBookRecordList(bookRecord);
    }

    /**
     * 新增领还记录表单
     * 
     * @param bookRecord 领还记录表单
     * @return 结果
     */
    @Override
    public int insertBookRecord(BookRecord bookRecord)
    {
        bookRecord.setCreateTime(DateUtils.getNowDate());
        return bookRecordMapper.insertBookRecord(bookRecord);
    }

    /**
     * 修改领还记录表单
     * 
     * @param bookRecord 领还记录表单
     * @return 结果
     */
    @Override
    public int updateBookRecord(BookRecord bookRecord)
    {
        bookRecord.setUpdateTime(DateUtils.getNowDate());
        return bookRecordMapper.updateBookRecord(bookRecord);
    }

    /**
     * 批量删除领还记录表单
     * 
     * @param ids 需要删除的领还记录表单主键
     * @return 结果
     */
    @Override
    public int deleteBookRecordByIds(String[] ids)
    {
        return bookRecordMapper.deleteBookRecordByIds(ids);
    }

    /**
     * 删除领还记录表单信息
     * 
     * @param id 领还记录表单主键
     * @return 结果
     */
    @Override
    public int deleteBookRecordById(String id)
    {
        return bookRecordMapper.deleteBookRecordById(id);
    }
}
